﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;

namespace LuoYi.Admin.Entities;

/// <summary>
/// 角色信息表
/// </summary>
[Table("sys_role")]
public class SysRole : IEntity
{
    /// <summary>
    /// 角色ID
    /// </summary>
    [Key]
    [Column("role_id", TypeName = "bigint(20)")]
    public long RoleId { get; set; }

    /// <summary>
    /// 角色名称
    /// </summary>
    [Column("role_name")]
    [StringLength(30)]
    public string RoleName { get; set; } = null!;

    /// <summary>
    /// 角色权限字符串
    /// </summary>
    [Column("role_key")]
    [StringLength(100)]
    public string RoleKey { get; set; } = null!;

    /// <summary>
    /// 显示顺序
    /// </summary>
    [Column("role_sort", TypeName = "int(4)")]
    public int RoleSort { get; set; }

    /// <summary>
    /// 数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）
    /// </summary>
    [Column("data_scope")]
    [StringLength(1)]
    public string? DataScope { get; set; }

    /// <summary>
    /// 菜单树选择项是否关联显示
    /// </summary>
    [Column("menu_check_strictly")]
    public bool? MenuCheckStrictly { get; set; }

    /// <summary>
    /// 部门树选择项是否关联显示
    /// </summary>
    [Column("dept_check_strictly")]
    public bool? DeptCheckStrictly { get; set; }

    /// <summary>
    /// 角色状态（0正常 1停用）
    /// </summary>
    [Column("status")]
    [StringLength(1)]
    public string Status { get; set; } = null!;

    /// <summary>
    /// 删除标志（0代表存在 2代表删除）
    /// </summary>
    [Column("del_flag")]
    [StringLength(1)]
    public string? DelFlag { get; set; }

    /// <summary>
    /// 创建者
    /// </summary>
    [Column("create_by")]
    [StringLength(64)]
    public string? CreateBy { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column("create_time", TypeName = "datetime")]
    public DateTime? CreateTime { get; set; }

    /// <summary>
    /// 更新者
    /// </summary>
    [Column("update_by")]
    [StringLength(64)]
    public string? UpdateBy { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    [Column("update_time", TypeName = "datetime")]
    public DateTime? UpdateTime { get; set; }

    /// <summary>
    /// 备注
    /// </summary>
    [Column("remark")]
    [StringLength(500)]
    public string? Remark { get; set; }
}
